<?php echo $this->Html->css('form'); ?>
<?php echo $this->Html->css('search'); ?>
<?php echo $this->Html->script('ckeditor/ckeditor'); ?>

<?php
$myControl = $this->params["controller"];
$myAction = $this->params["action"];

$cont = Inflector::classify($myControl);
$act = Inflector::camelize($myAction);
?>
<?php echo $this->Form->create('Deal',array('url'=>'/deals/add','id' => "{$cont}{$act}Form",'enctype' => 'multipart/form-data'));?>

<div class="contentMain">
<div class="grayBox">

<div class="form_wrapper">
	<h2>Create new deal</h2>
	<ul class="addBox">
		<li>
			<span class="titleName"><label>Product</label></span>
			<?php
				echo $form->input('product_id', array(
					'options' => $products,
					'label' => false,
					'div' => false,
					'style' => 'width: 20%',
					'value' => $current_product
					));
			?>
		</li>
		<li>
			<span class="titleName"><label>Price</label></span>
			<?php
				echo $form->text('price');
				echo '&nbsp;';
				echo $form->error('price',array('class'=>'error-message'));
			?>
		</li>
		<li>
			<span class="titleName"><label>Description</label></span>
			<div class="editorBox" style="margin-left:25.5%;width:74%;margin-top:-20px">
				<?php
					echo $form->textarea('description', array('id' => 'description', 'class' => 'ckeditor'));
					echo $form->error('description',array('class'=>'error-message'));
				?>
			</div>
		</li>
	</ul>
	<?=$this->Form->button(__('Save and publish', true), array('class' => 'btnYellow01 btn', 'type' => 'submit', 'style'=>'display:none', 'id'=>'save_publish','name'=>'savePublish')); ?>
	<a style="float:left;margin-right:5px;margin-left:25.5%;margin-top:30px" class="button" href="#" onclick="$('#save_publish').click(); return false;"><span class="btnBg">Add Deal</span></a>
	<a href="<?=$this->webroot?>" class="button" style="float:left;margin-top:30px"><span class="btnBg">Cancel</span></a>
</div>

</div>
</div>

<?php
echo $this->Form->end();
?>
